package com.lightkits.wms.database.entity.willsemiinterface;

import java.math.BigDecimal;
import java.util.Date;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.annotations.TableLogic;
import java.io.Serializable;

import com.baomidou.mybatisplus.enums.FieldFill;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import com.lightkits.framework.database.entity.BaseModel;

/**
 * <p>
 * 现有量表
 * </p>
 *
 * @author lanmi.xin@gmail.com
 * Created on 2019-07-24
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("bd_onhand_mediate")
public class BdOnhandMediate extends BaseModel<BdOnhandMediate> {

    private static final long serialVersionUID = 1L;

    /**
     * 创建人
     */
    @TableField(value = "CREATED_BY", fill = FieldFill.INSERT)
    private Long createdBy;

    /**
     * 创建时间
     */
    @TableField(value = "CREATION_DATE", fill = FieldFill.INSERT)
    private Date creationDate;

    /**
     * 最后更新人
     */
    @TableField(value = "LAST_UPDATED_BY", fill = FieldFill.INSERT_UPDATE)
    private Long lastUpdatedBy;

    /**
     * 最后更新时间
     */
    @TableField(value = "LAST_UPDATE_DATE", fill = FieldFill.INSERT_UPDATE)
    private Date lastUpdateDate;

    /**
     * 最后更新时登录ID
     */
    @TableField(value = "LAST_UPDATE_LOGIN", fill = FieldFill.INSERT_UPDATE)
    private Long lastUpdateLogin;

    @TableField(value = "CID", fill = FieldFill.INSERT_UPDATE)
    private Long cid;

    /**
     * 关联SYS_TENANT表中的TENANT_ID
     */
    @TableField(value = "TENANT_ID", fill = FieldFill.INSERT)
    private Long tenantId;

    /**
     * 现有量ID，由系统自动生成，保证全局唯一
     */
    @TableId("ID")
    private Long id;

    /**
     * 现有量所属组织ID
     */
    @TableField("ORGANIZATION_ID")
    private Long organizationId;

    /**
     * 物料ID
     */
    @TableField("ITEM_ID")
    private Long itemId;

    /**
     * 单位
     */
    @TableField("UOM")
    private String uom;

    /**
     * 数量
     */
    @TableField("QUANTITY")
    private BigDecimal quantity;

    /**
     * 主单位
     */
    @TableField("PRIMARY_UOM")
    private String primaryUom;

    /**
     * 主单位数量
     */
    @TableField("PRIMARY_QUANTITY")
    private BigDecimal primaryQuantity;

    /**
     * 批次
     */
    @TableField("LOT_NUMBER")
    private String lotNumber;

    /**
     * 仓库
     */
    @TableField("WAREHOUSE_ID")
    private Long warehouseId;

    /**
     * 货位
     */
    @TableField("WM_AREA_ID")
    private Long wmAreaId;

    /**
     * 货格
     */
    @TableField("STORAGE_UNIT_CODE")
    private String storageUnitCode;

    /**
     * 所有者类型
     */
    @TableField("OWNER_TYPE")
    private String ownerType;

    /**
     * 所有者类型
     */
    @TableField("OWNER_ID")
    private Long ownerId;

    /**
     * 特征类型，比如颜色、质量等级等
     */
    @TableField("FEATURE_TYPE")
    private String featureType;

    /**
     * 特征值
     */
    @TableField("FEATURE_VALUE")
    private String featureValue;

    /**
     * 现有量是否合并标识
     */
    @TableField("MERGE_FLAG")
    private Boolean mergeFlag;

    /**
     * 是否同步
     */
    @TableField("TRANS_FLAG")
    private Boolean transFlag;

    /**
     * 逻辑删除标记
     */
    @TableField("DELETE_FLAG")
    @TableLogic
    private Boolean deleteFlag;

    /**
     * 批次流水号
     */
    @TableField("BATCH_NUMBER")
    private String batchNumber;

    /**
     * 现有量ID
     */
    @TableField("ON_HAND_ID")
    private Long onHandId;


    public static final String CREATED_BY = "CREATED_BY";

    public static final String CREATION_DATE = "CREATION_DATE";

    public static final String LAST_UPDATED_BY = "LAST_UPDATED_BY";

    public static final String LAST_UPDATE_DATE = "LAST_UPDATE_DATE";

    public static final String LAST_UPDATE_LOGIN = "LAST_UPDATE_LOGIN";

    public static final String CID = "CID";

    public static final String TENANT_ID = "TENANT_ID";

    public static final String ID = "ID";

    public static final String ORGANIZATION_ID = "ORGANIZATION_ID";

    public static final String ITEM_ID = "ITEM_ID";

    public static final String UOM = "UOM";

    public static final String QUANTITY = "QUANTITY";

    public static final String PRIMARY_UOM = "PRIMARY_UOM";

    public static final String PRIMARY_QUANTITY = "PRIMARY_QUANTITY";

    public static final String LOT_NUMBER = "LOT_NUMBER";

    public static final String WAREHOUSE_ID = "WAREHOUSE_ID";

    public static final String WM_AREA_ID = "WM_AREA_ID";

    public static final String STORAGE_UNIT_CODE = "STORAGE_UNIT_CODE";

    public static final String OWNER_TYPE = "OWNER_TYPE";

    public static final String OWNER_ID = "OWNER_ID";

    public static final String FEATURE_TYPE = "FEATURE_TYPE";

    public static final String FEATURE_VALUE = "FEATURE_VALUE";

    public static final String MERGE_FLAG = "MERGE_FLAG";

    public static final String TRANS_FLAG = "TRANS_FLAG";

    public static final String DELETE_FLAG = "DELETE_FLAG";

    public static final String BATCH_NUMBER = "BATCH_NUMBER";

    public static final String ON_HAND_ID = "ON_HAND_ID";

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}